Skip to content

tests: Added test to fix masking for pem and jwk keys. - #2139

Merged
shivaygupta-dotcom merged 11 commits into
mainfrom
fix/env-var-masking-pem-jwk-keys
Aug 3, 2026
Merged

tests: Added test to fix masking for pem and jwk keys.#2139
shivaygupta-dotcom merged 11 commits into
mainfrom
fix/env-var-masking-pem-jwk-keys

Conversation

@shivaygupta-dotcom

@shivaygupta-dotcom shivaygupta-dotcom commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Added test for env var masking fix for PEM and JWK keys.

GH: #2132
gdrPR: Kong/go-database-reconciler#494

@codecov-commenter

codecov-commenter commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.92%. Comparing base (de45b44) to head (c9bfa62).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2139   +/-   ##
=======================================
  Coverage   35.92%   35.92%           
=======================================
  Files          82       82           
  Lines        7832     7832           
=======================================
  Hits         2814     2814           
  Misses       4753     4753           
  Partials      265      265           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shivaygupta-dotcom shivaygupta-dotcom added skip-konnect Skip Konnect Integration tests in CI and removed skip-konnect Skip Konnect Integration tests in CI labels Jul 9, 2026
@shivaygupta-dotcom
shivaygupta-dotcom marked this pull request as ready for review July 10, 2026 06:56
@shivaygupta-dotcom
shivaygupta-dotcom force-pushed the fix/env-var-masking-pem-jwk-keys branch from 6470ba0 to dfc63a7 Compare July 16, 2026 11:02
@shivaygupta-dotcom
shivaygupta-dotcom force-pushed the fix/env-var-masking-pem-jwk-keys branch from 78b1b49 to 00a1d45 Compare July 29, 2026 15:33
@shivaygupta-dotcom
shivaygupta-dotcom force-pushed the fix/env-var-masking-pem-jwk-keys branch from 247b6eb to 1b5d19d Compare July 30, 2026 06:29
require.Contains(t, output, `"Authorization:Bearer [masked]"`, "bearer token should be masked")
require.Contains(t, output, `"X-Webhook-Secret:[masked]"`, "webhook secret should be masked")

// Verify the current secret values are NOT exposed in the output

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the older secrets, like apiKeySecret? Can we check for absence of those too below? Those shouldn't leak either.

@shivaygupta-dotcom shivaygupta-dotcom Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand your comment correctly, you’re referring to verifying the secret that was set during the first sync, for example:
t.Setenv("DECK_API_KEY", "apiKeySecret")

This is actually a known issue. When we run sync again after changing the environment variable value, the previous secret can be exposed in the output. We’re already addressing this as part of a separate issue. #2140

Please let me know if I misunderstood your comment or if you were referring to something else.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Everything else looks fine to me. Will approve once the CI is green.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. you can approve now.

@shivaygupta-dotcom
shivaygupta-dotcom merged commit d2c701c into main Aug 3, 2026
49 checks passed
@shivaygupta-dotcom
shivaygupta-dotcom deleted the fix/env-var-masking-pem-jwk-keys branch August 3, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants